package diolag


import activity.ReleaseActivity
import android.app.Dialog
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import android.widget.ImageView
import com.wd.rim.R


class EditActivity(context: Context): Dialog(context) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_edit)
        initView()
        val send = findViewById<ImageView>(R.id.send)
        val sendVideo = findViewById<ImageView>(R.id.sendVideo)
        sendVideo.setOnClickListener {
//            val intent = Intent()
//            intent.setClass(context,ReleaseActivity::class.java)
//            context.startActivity(intent)
        }
        send.setOnClickListener {
            AA(it)
        }
    }



    private fun initView(){
        val window = this.window
        if(window!=null){
            window.setGravity(Gravity.BOTTOM)
            window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
            val lp=window.attributes
            lp.width= WindowManager.LayoutParams.MATCH_PARENT
            lp.height= WindowManager.LayoutParams.WRAP_CONTENT
        }

    }

    fun AA(view: View) {
        when (view.id) {
            R.id.send -> view.context.startActivity(
                Intent(
                    view.context,
                    ReleaseActivity::class.java
                )
            )

            else -> {}
        }
    }

}